package com.xu.myTest;

import com.alibaba.fastjson.JSONObject;
import com.google.common.collect.Lists;
import com.xu.model.AbstractSchool;
import com.xu.model.Student;
import com.xu.model.Teacher;

import java.util.List;

public class AbstractJSON {
    public static void main(String[] args) {
        List<Student> list = Lists.newArrayList(
                new Student("001", "静静"), new Student("002", "小明"));
        List<Student> list2 = Lists.newArrayList(
                new Student("003", "卡卡"), new Student("004", "猪猪"));
        List<Teacher> teacherList = Lists.newArrayList(new Teacher("我是老师",list));
        teacherList.add(new Teacher("我也是老师",list2));
        AbstractSchool<Teacher> schoolTeacher = new AbstractSchool<Teacher>();

        schoolTeacher.setNum(teacherList.size());
        schoolTeacher.setSchoolName("我是大学");
        schoolTeacher.setHuman(teacherList);

        System.out.println(JSONObject.toJSONString(schoolTeacher,true));



    }


}
